$(function () {


    $('#log-out').click(function () {
        //清楚session
        $.ajax({
            url: '/o2o/local/logout',
            type: 'post',
            async: false,
            cache: false,
            dataType: 'json',
            success: function (data) {
                if (data.success) {
                    var userType = $('#log-out').attr('usertype');

                    //清楚成功，退回登陆页面
                    window.location.href = '/o2o/local/login?usertype=' + userType;
                    return false;
                }
            },
            error: function (data, error) {
                alert(error);
            }
        });
    });

})